package com.koron.operation.dispatch.bean;

import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 *
 */
@Data
@ApiModel(value = "系统管理-配置详情 - 机组与监控数据库的对应关系")
public class UnitRelationDo {

    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "所属配置id")
    private String configId;

    @ApiModelProperty(value = "所属租户id")
    private String appid;

    @ApiModelProperty(value = "后端使用")
    private String key;

    @ApiModelProperty(value = "前端使用")
    private String value;

    @ApiModelProperty(value = "描述")
    private String description;

    @ApiModelProperty(value = "删除标志",notes = "0-在使用；1-已删除")
    private Integer deleteFlag;

    @ApiModelProperty(value = "部门")
    private String deptId;

    @ApiModelProperty(value = "监控系统数据库")
    private String dbs;


    public void splitToDescription(){
        List<String> split = StrUtil.split(this.description, '-');
        this.dbs = split.get(0);//获取机组对应的数据源
    }
}
